package com.lp.security.schedule;

import com.lp.biz.train.mapper.BizTrainClassMemberRelMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * GraduationSchedule
 *
 * @program: backend
 * @description:
 * @author: Ke.Song
 * @since: 2024-06-07 14:56:45
 **/
@Slf4j
@Component
public class GraduationSchedule {

    @Autowired
    private BizTrainClassMemberRelMapper classMemberRelMapper;

    @Scheduled(cron = "0 */30 * * * ?")
    @Transactional(rollbackFor = RuntimeException.class)
    public void graduationHandler() {
        log.info("结业: 开始处理结业");
        classMemberRelMapper.updateGraduation();
        log.info("结业: 处理结业结束");
    }
}
